package com.xxchat.entity.enums;

import lombok.Getter;

import java.util.Objects;

/**
 * @author Waicc
 */
@Getter
public enum UserStatusEnum {
    DISABLED(0, "禁用"),
    ENABLE(1, "可用");

    private final Integer status;
    private final String desc;

    public static UserStatusEnum getByStatus(Integer status) {
        for (UserStatusEnum e : UserStatusEnum.values()) {
            if (Objects.equals(e.status, status)) {
                return e;
            }
        }
        return null;
    }

    UserStatusEnum(Integer status, String desc) {
        this.status = status;
        this.desc = desc;
    }
}
